class CQueue {
    private stack1: number[];
    private stack2: number[];

    constructor() {
        this.stack1 = [];
        this.stack2 = [];
    }

    appendTail(value: number): void {
        this.stack1.push(value);
    }

    deleteHead(): number {

        if (this.stack2.length <= 0) {
            for (let value: number | undefined = this.stack1.pop(); value != null; value = this.stack1.pop()) {
                this.stack2.push(value);
                // console.log(this.stack1, this.stack2);
            }
        }
        let result: number | undefined = this.stack2.pop();

        if (result == null) {
            return -1;
        }
        return result;

    }
}

// var obj = new CQueue();
// obj.appendTail(1);
// var param_2 = obj.deleteHead();
// console.log(param_2);
/**
 * Your CQueue object will be instantiated and called as such:
 * var obj = new CQueue()
 * obj.appendTail(value)
 * var param_2 = obj.deleteHead()
 */